package com.whfc.quality.service;

import com.whfc.common.exception.BizException;
import com.whfc.common.result.PageVO;
import com.whfc.entity.dto.statistics.CheckDetailDTO;
import com.whfc.entity.dto.statistics.CheckStatisticsDTO;
import com.whfc.entity.dto.statistics.StatisticsProgressDTO;
import com.whfc.entity.param.check.CheckSearchParam;
import com.whfc.quality.dto.*;
import com.whfc.quality.param.QualityCheckListParam;
import com.whfc.quality.param.QualityCheckLogParam;
import com.whfc.quality.param.QualityCheckParam;

import java.util.Date;
import java.util.List;

/**
 * @author hw
 * @version 1.0
 * @classsName QualityCheckService
 * @description 问题上报接口类
 * @date 2020/7/30 8:57
 */
public interface QualityCheckService {

    /**
     * 质量问题上报
     *
     * @param qualityCheckParam 问题上报请求类
     * @return void
     * @throws BizException 业务异常
     * @Author hw
     * @Date 2020/7/30
     **/
    void addCheck(QualityCheckParam qualityCheckParam) throws BizException;

    /**
     * 删除记录ID
     * @param checkId 记录ID
     * @throws BizException 业务异常
     */
    void delCheck(Integer checkId) throws BizException;

    /**
     * 质量问题处理流程
     *
     * @param qualityCheckLogParam 质量问题流程处理请求类
     * @throws BizException 业务异常
     * @Author hw
     * @Date 2020/7/30
     * @return: 需要发送的消息内容
     **/
    void addCheckLog(QualityCheckLogParam qualityCheckLogParam) throws BizException;

    /**
     * 查询问题上报列表
     *
     * @param qualityCheckListParam 问题上报请求类
     * @return PageData
     * @throws BizException 业务异常
     * @author hw
     * @date 2020/7/31 14:13
     **/
    QualityCheckListDTO list(QualityCheckListParam qualityCheckListParam) throws BizException;

    /**
     * 查询问题上报列表
     *
     * @param qualityCheckListParam 问题上报请求类
     * @return List
     * @throws BizException 业务异常
     * @author hw
     * @date 2020/7/31 14:13
     **/
    List<QualityCheckDTO> dayLogList(QualityCheckListParam qualityCheckListParam) throws BizException;

    /**
     * 查询问题上报详情
     *
     * @param checkId 问题id
     * @return QualityCheckDescDTO
     * @throws BizException 业务异常
     * @author hw
     * @date 2020/8/1 9:00
     **/
    QualityCheckDescDTO desc(Integer checkId) throws BizException;

    /**
     * 查询统计信息
     *
     * @param deptId    组织机构ID
     * @param channel   渠道code 1-日；2-年；3-自定义
     * @param startTime 开始时间
     * @param endTime   结束时间
     * @return QualityCheckStatisticalDTO
     * @throws BizException 业务异常
     * @author hw
     * @date 2020/8/3 17:35
     **/
    QualityCheckStatisticalDTO statistical(Integer deptId, Integer userId, Date startTime, Date endTime, Integer channel) throws BizException;

    /**
     * 查询当前时间已超期的上报ID
     *
     * @return List<QualityCheckDTO>
     * @throws BizException 业务异常
     * @author hw
     * @date 2020/8/12 9:19
     **/
    List<Integer> getCheckIds() throws BizException;

    /**
     * 更新超期状态
     *
     * @param checkIds 问题id
     * @return
     * @throws BizException 业务异常
     * @author hw
     * @date 2020/8/12 11:28
     **/
    void updateOverdue(List<Integer> checkIds) throws BizException;


    /**
     * 问题日志
     *
     * @param deptId
     * @param date
     * @return
     * @throws BizException
     */
    QualityLogDTO qualityLog(Integer deptId, Date date) throws BizException;


    /**
     * 导出隐患问题
     *
     * @param qualityIds
     * @param deptId
     * @throws BizException
     */
    void qualityExport(List<Integer> qualityIds, Integer deptId) throws BizException;


    /**
     * 检查统计
     *
     * @param deptId
     * @param startTime
     * @param endTime
     * @return
     * @throws BizException
     */
    QualityCheckScreenDTO qualityCheckScreenStatistical(Integer deptId, Date startTime, Date endTime) throws BizException;


    /**
     * 上报问题类别分析
     *
     * @param deptId
     * @param startTime
     * @param endTime
     * @return
     * @throws BizException
     */
    QualityCheckScreenDTO qualityCheckTypeAnalysis(Integer deptId, Date startTime, Date endTime) throws BizException;

    /**
     * 未销问题分析
     *
     * @param deptId
     * @param startTime
     * @param endTime
     * @return
     * @throws BizException
     */
    QualityCheckUnfinishedDTO qualityCheckUnfinished(Integer deptId, Date startTime, Date endTime) throws BizException;


    /**
     * 上报问题部位分析
     *
     * @param deptId
     * @param startTime
     * @param endTime
     * @return
     * @throws BizException
     */
    List<QualityCheckPartStatisticalDTO> qualityCheckPartAnalysis(Integer deptId, Date startTime, Date endTime) throws BizException;

    List<QualityCheckDescDTO> descByIds(List<Integer> checkIds) throws BizException;


    StatisticsProgressDTO getStatisticsProgressDTO(Integer deptId, Integer userId, String startTime, String endTime);

    CheckStatisticsDTO getCheckStatistics(CheckSearchParam param);

    PageVO<CheckDetailDTO> getCheckPage(CheckSearchParam param);

    void deleteBatch(List<Integer> idList);
}
